package com.seafood.dto;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * 创建订单请求DTO
 */
@Data
public class CreateOrderDTO {
    
    @NotEmpty(message = "订单商品不能为空")
    private List<OrderItemRequest> items;
    
    private String shippingAddress;
    
    private String recipientName;
    
    private String recipientPhone;
    
    private String remark;
    
    // 添加运费字段
    private BigDecimal shippingFee = BigDecimal.ZERO;
    
    /**
     * 订单商品请求
     */
    @Data
    public static class OrderItemRequest {
        
        @NotNull(message = "产品ID不能为空")
        private Long productId;
        
        @NotNull(message = "数量不能为空")
        private Integer quantity;
        
        private String batchNumber;
    }
}